<!DOCTYPE html>
<html lang=zh>
<head>
  <meta charset="utf-8">
  
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no, minimal-ui">
  <meta name="renderer" content="webkit">
  <meta http-equiv="Cache-Control" content="no-transform" />
  <meta http-equiv="Cache-Control" content="no-siteapp" />
  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="apple-mobile-web-app-status-bar-style" content="black">
  <meta name="format-detection" content="telephone=no,email=no,adress=no">
  <!-- Color theme for statusbar -->
  <meta name="theme-color" content="#000000" />
  <!-- 强制页面在当前窗口以独立页面显示,防止别人在框架里调用页面 -->
  <meta http-equiv="window-target" content="_top" />
  
  
  <title>书单 | Hexo</title>
  <meta property="og:type" content="website">
<meta property="og:title" content="书单">
<meta property="og:url" content="http://molkt.cn/books/index.html">
<meta property="og:site_name" content="Hexo">
<meta property="og:locale" content="zh_CN">
<meta property="article:published_time" content="2021-11-19T12:36:14.246Z">
<meta property="article:modified_time" content="2021-11-19T12:36:14.246Z">
<meta property="article:author" content="John Doe">
<meta name="twitter:card" content="summary">
  <!-- Canonical links -->
  <link rel="canonical" href="http://molkt.cn/books/index.html">
  
    <link rel="alternate" href="/atom.xml" title="Hexo" type="application/atom+xml">
  
  
    <link rel="icon" href="/favicon.png" type="image/x-icon">
  
  
<link rel="stylesheet" href="/css/style.css">

  
  
  
  
<meta name="generator" content="Hexo 5.4.0"></head>


<body class="main-center no-sidebar" itemscope itemtype="http://schema.org/WebPage">
  <header class="header" itemscope itemtype="http://schema.org/WPHeader">
  <div class="slimContent">
    <div class="navbar-header">
      
      
      <div class="profile-block text-center">
        <a id="avatar" href="https://github.com/molkt" target="_blank">
          <img class="img-circle img-rotate" src="/images/avatar.jpg" width="200" height="200">
        </a>
        <h2 id="name" class="hidden-xs hidden-sm">子牛</h2>
        <h3 id="title" class="hidden-xs hidden-sm hidden-md">C Developer</h3>
        <small id="location" class="text-muted hidden-xs hidden-sm"><i class="icon icon-map-marker"></i> Shanghai, China</small>
      </div>
      
      <div class="search" id="search-form-wrap">

    <form class="search-form sidebar-form">
        <div class="input-group">
            <input type="text" class="search-form-input form-control" placeholder="搜索" />
            <span class="input-group-btn">
                <button type="submit" class="search-form-submit btn btn-flat" onclick="return false;"><i class="icon icon-search"></i></button>
            </span>
        </div>
    </form>
    <div class="ins-search">
  <div class="ins-search-mask"></div>
  <div class="ins-search-container">
    <div class="ins-input-wrapper">
      <input type="text" class="ins-search-input" placeholder="想要查找什么..." x-webkit-speech />
      <button type="button" class="close ins-close ins-selectable" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
    </div>
    <div class="ins-section-wrapper">
      <div class="ins-section-container"></div>
    </div>
  </div>
</div>


</div>
      <button class="navbar-toggle collapsed" type="button" data-toggle="collapse" data-target="#main-navbar" aria-controls="main-navbar" aria-expanded="false">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
    </div>
    <nav id="main-navbar" class="collapse navbar-collapse" itemscope itemtype="http://schema.org/SiteNavigationElement" role="navigation">
      <ul class="nav navbar-nav main-nav ">
        
        
        <li class="menu-item menu-item-home">
          <a href="/.">
            
            <i class="icon icon-home-fill"></i>
            
            <span class="menu-title">首页</span>
          </a>
        </li>
        
        
        <li class="menu-item menu-item-archives">
          <a href="/archives">
            
            <i class="icon icon-archives-fill"></i>
            
            <span class="menu-title">归档</span>
          </a>
        </li>
        
        
        <li class="menu-item menu-item-categories">
          <a href="/categories">
            
            <i class="icon icon-folder"></i>
            
            <span class="menu-title">分类</span>
          </a>
        </li>
        
        
        <li class="menu-item menu-item-tags">
          <a href="/tags">
            
            <i class="icon icon-tags"></i>
            
            <span class="menu-title">标签</span>
          </a>
        </li>
        
        
        <li class="menu-item menu-item-repository">
          <a href="/repository">
            
            <i class="icon icon-project"></i>
            
            <span class="menu-title">项目</span>
          </a>
        </li>
        
      </ul>
      
    </nav>
  </div>
</header>

  
    <aside class="sidebar" itemscope itemtype="http://schema.org/WPSideBar">
  <div class="slimContent">
    
      <div class="widget">
    <h3 class="widget-title">公告</h3>
    <div class="widget-body">
        <div id="board">
            <div class="content">
                <p>欢迎交流与分享经验!</p>
            </div>
        </div>
    </div>
</div>

    
      
  <div class="widget">
    <h3 class="widget-title">分类</h3>
    <div class="widget-body">
      <ul class="category-list"><li class="category-list-item"><a class="category-list-link" href="/categories/C-Development/">C Development</a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/Git/">Git</a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/%E6%9D%82%E6%8A%80/">杂技</a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/%E7%AE%97%E6%B3%95/">算法</a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/%E9%9A%8F%E6%83%B3/">随想</a><span class="category-list-count">1</span></li></ul>
    </div>
  </div>


    
      
  <div class="widget">
    <h3 class="widget-title">标签</h3>
    <div class="widget-body">
      <ul class="tag-list" itemprop="keywords"><li class="tag-list-item"><a class="tag-list-link" href="/tags/C/" rel="tag">C</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/git/" rel="tag">git</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/%E4%BC%98%E5%8C%96/" rel="tag">优化</a><span class="tag-list-count">1</span></li></ul>
    </div>
  </div>


    
      
  <div class="widget">
    <h3 class="widget-title">标签云</h3>
    <div class="widget-body tagcloud">
      <a href="/tags/C/" style="font-size: 13px;">C</a> <a href="/tags/git/" style="font-size: 13px;">git</a> <a href="/tags/%E4%BC%98%E5%8C%96/" style="font-size: 13px;">优化</a>
    </div>
  </div>

    
      
  <div class="widget">
    <h3 class="widget-title">归档</h3>
    <div class="widget-body">
      <ul class="archive-list"><li class="archive-list-item"><a class="archive-list-link" href="/archives/2021/11/">十一月 2021</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2020/05/">五月 2020</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2020/04/">四月 2020</a><span class="archive-list-count">2</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2020/03/">三月 2020</a><span class="archive-list-count">1</span></li></ul>
    </div>
  </div>


    
      
  <div class="widget">
    <h3 class="widget-title">最新文章</h3>
    <div class="widget-body">
      <ul class="recent-post-list list-unstyled no-thumbnail">
        
          <li>
            
            <div class="item-inner">
              <p class="item-category">
                <a class="category-link" href="/categories/C-Development/">C Development</a>
              </p>
              <p class="item-title">
                <a href="/2021/11/20/%E5%8D%8E%E4%B8%BAC%E8%AF%AD%E8%A8%80%E8%A7%84%E8%8C%83/" class="title">华为C语言规范</a>
              </p>
              <p class="item-date">
                <time datetime="2021-11-20T11:56:11.000Z" itemprop="datePublished">2021-11-20</time>
              </p>
            </div>
          </li>
          
          <li>
            
            <div class="item-inner">
              <p class="item-category">
                <a class="category-link" href="/categories/%E7%AE%97%E6%B3%95/">算法</a>
              </p>
              <p class="item-title">
                <a href="/2020/05/22/%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84%E4%B8%8E%E7%AE%97%E6%B3%95%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/" class="title">数据结构与算法学习笔记</a>
              </p>
              <p class="item-date">
                <time datetime="2020-05-22T00:19:34.000Z" itemprop="datePublished">2020-05-22</time>
              </p>
            </div>
          </li>
          
          <li>
            
            <div class="item-inner">
              <p class="item-category">
                <a class="category-link" href="/categories/Git/">Git</a>
              </p>
              <p class="item-title">
                <a href="/2020/04/13/git%E5%B8%B8%E7%94%A8%E5%91%BD%E4%BB%A4%E6%95%B4%E7%90%86/" class="title">Git常用命令整理</a>
              </p>
              <p class="item-date">
                <time datetime="2020-04-13T14:32:20.000Z" itemprop="datePublished">2020-04-13</time>
              </p>
            </div>
          </li>
          
          <li>
            
            <div class="item-inner">
              <p class="item-category">
                <a class="category-link" href="/categories/%E6%9D%82%E6%8A%80/">杂技</a>
              </p>
              <p class="item-title">
                <a href="/2020/04/01/Hexo%E6%90%AD%E5%BB%BA%E4%B8%AA%E4%BA%BA%E5%8D%9A%E5%AE%A2/" class="title">Hexo搭建个人博客</a>
              </p>
              <p class="item-date">
                <time datetime="2020-04-01T14:05:14.000Z" itemprop="datePublished">2020-04-01</time>
              </p>
            </div>
          </li>
          
          <li>
            
            <div class="item-inner">
              <p class="item-category">
                <a class="category-link" href="/categories/%E9%9A%8F%E6%83%B3/">随想</a>
              </p>
              <p class="item-title">
                <a href="/2020/03/28/%E4%B8%BA%E4%BB%80%E4%B9%88%E5%BA%94%E8%AF%A5%E5%9D%9A%E6%8C%81%E5%86%99%E5%8D%9A%E5%AE%A2%EF%BC%9F/" class="title">为什么应该坚持写博客？</a>
              </p>
              <p class="item-date">
                <time datetime="2020-03-28T04:12:00.000Z" itemprop="datePublished">2020-03-28</time>
              </p>
            </div>
          </li>
          
      </ul>
    </div>
  </div>
  

    
  </div>
</aside>

  
  <main class="main" role="main">
  <article class="article article-links article-type-list" itemscope="">
  <header class="article-header">
    <h1 itemprop="title">书单</h1>
    <p class="text-muted">个人收藏的书单推荐给大家 <a href="https://www.douban.com/people//" target="_blank">[我的豆瓣]</a></p>
    <nav role="navigation" id="nav-main" class="okayNav">
      <ul id="tabs">
        <li><a id="reading-tab" href="javascript:show('reading')" rel="external">在读<span id="reading-total"></span></a></li>
        <li><a id="wish-tab" href="javascript:show('wish')" rel="external">想读<span id="wish-total"></span></a></li>
        <li><a id="read-tab" href="javascript:show('read')" rel="external">已读<span id="read-total"></span></a></li>
      </ul>
    </nav>
  </header>
  <div class="article-body">
    <div id="loading">
      <p>正在加载...</p>
    </div>
    <div id="douban">
      <div id="collections">
        <div id="reading" class="row hide">
        </div>
        <div class="clearfix"></div>
        <div id="wish" class="row hide">
        </div>
        <div class="clearfix"></div>
        <div id="read" class="row hide">
        </div>
        <div class="clearfix"></div>
      </div>
    </div>
  </div>
</article>

  



</main>

  <footer class="footer" itemscope itemtype="http://schema.org/WPFooter">
	
    <div class="copyright">
    	
        <div class="publishby">
        	Theme by <a href="https://github.com/cofess" target="_blank"> cofess </a>base on <a href="https://github.com/cofess/hexo-theme-pure" target="_blank">pure</a>.
        </div>
    </div>
</footer>
  <script src="//cdn.jsdelivr.net/npm/jquery@1.12.4/dist/jquery.min.js"></script>
<script>
window.jQuery || document.write('<script src="js/jquery.min.js"><\/script>')
</script>

<script src="/js/plugin.min.js"></script>


<script src="/js/application.js"></script>


    <script>
(function (window) {
    var INSIGHT_CONFIG = {
        TRANSLATION: {
            POSTS: '文章',
            PAGES: '页面',
            CATEGORIES: '分类',
            TAGS: '标签',
            UNTITLED: '(未命名)',
        },
        ROOT_URL: '/',
        CONTENT_URL: '/content.json',
    };
    window.INSIGHT_CONFIG = INSIGHT_CONFIG;
})(window);
</script>

<script src="/js/insight.js"></script>





   <script>
function show(id) {
  document.getElementById('reading').classList.remove('active');
  document.getElementById('read').classList.remove('active');
  document.getElementById('wish').classList.remove('active');
  document.getElementById('reading').classList.add('hide');
  document.getElementById('read').classList.add('hide');
  document.getElementById('wish').classList.add('hide');

  var ele = document.getElementById(id);
  ele.classList.remove('hide');
  ele.classList.add('active');

  document.getElementById('reading-tab').classList.remove('active');
  document.getElementById('read-tab').classList.remove('active');
  document.getElementById('wish-tab').classList.remove('active');
  document.getElementById(id + '-tab').classList.add('active');
};

(function() {
  var read = [];
  var wish = [];
  var reading = [];

  // XHR 获取豆瓣书单数据，数据格式json
  // function loadDoubanCollections() {
  //   var xhr = new XMLHttpRequest();
  //   // https://api.douban.com/v2/book/user/:name/collections
  //   xhr.open('GET', 'http://7b1fa0.com1.z0.glb.clouddn.com/douban-20170429-1.json', true);

  //   xhr.onload = function() {
  //     // console.log(this);
  //     if (this.status >= 200 && this.status < 300) {
  //       var res = JSON.parse(this.response);
  //       searchData = res;
  //       onLoadDouban(searchData);
  //     } else {
  //       console.error(this.statusText);
  //     }
  //   };

  //   xhr.onerror = function() {
  //     console.error(this.statusText);
  //   };

  //   xhr.send();
  // }
  
  // Ajax 获取豆瓣书单数据，数据格式json
  function loadDoubanCollections() {
    var _this = this;
    // https://api.douban.com/v2/book/user/:name/collections?start=0&count=100
    var url = "https://api.douban.com/v2/book/user//collections"
    $.ajax({
      url: url,
      type: 'GET',
      data: {
        start:0, // 从哪一条记录开始
        count:100, // 获取豆瓣书单数据条数
        apikey:'' // 豆瓣apikey
      },
      dataType: 'JSONP', //here
      success: function(data) {
        // console.log(data);
        onLoadDouban(data);
      }
    });
  }

  function onLoadDouban(data) {
    if (data['count'] > 0) {
      for (var i = 0; i < data['collections'].length; ++i) {
        resolveBook(data['collections'][i]);
      }
    }
    render();
  }

  function resolveBook(book) {
    if (book['status'] == 'read') {
      read.push(book);
    }
    if (book['status'] == 'wish') {
      wish.push(book);
    }
    if (book['status'] == 'reading') {
      reading.push(book);
    }
  }

  function render() {
    renderList(read, 'read');
    renderList(wish, 'wish');
    renderList(reading, 'reading');

    document.getElementById('reading-total').innerHTML = '(' + reading.length + ')';
    document.getElementById('read-total').innerHTML = '(' + read.length + ')';
    document.getElementById('wish-total').innerHTML = '(' + wish.length + ')';

    show('reading');
    document.getElementById('loading').classList.add('hide');
  }

  function renderList(list, id) {
    for (var i = 0; i < list.length; ++i) {
      var h = renderBook(list[i]);
      if (i > 0 && i % 4 == 3) {
        h += '<div class="clearfix"></div>';
      }
      document.getElementById(id).innerHTML = document.getElementById(id).innerHTML + h;
    }
  }

  function renderBook(book) {
    var html = '<div class="col-sm-6 col-md-6"><div class="panel panel-default hover-grow"><div class="panel-body">'
      + '<div class="media media-middle book book-' + book['status'] + '" itemscope itemtype="http://schema.org/Book">' 
      + '<div class="media-left"><a class="media-middle" target="_blank" href="' + book.book.alt + '" rel="external nofollow noopener noreferrer"><img class="media-object" src="' + book.book.image + '" itemprop="image"/></a></div><div class="media-body">' 
      + '<h3 class="media-heading" itemprop="name"><a target="_blank" href="' + book.book.alt + '" rel="external nofollow noopener noreferrer">' + book.book.title + '</a></h3>' 
      + '<p class="meta text-nowrap-1x"><small itemprop="author">' + book.book.author[0] + '</small> / <small itemprop="datePublished">' + book.book.pubdate + '</small> / <small itemprop="ratingValue">' + book.book.rating.average + '分</small></p>' 
      + '<p class="meta text-nowrap-1x">' + book.updated.substring(0, 10) + resolveRating(book.rating) + resolveTags(book.tags) + '</p>' 
      + '<div class="comments text-muted text-nowrap-3x" itemprop="comment">' + (book.comment ? book.comment : '') + '</div>' 
      + '</div>' + '</div>' + '</div>' + '</div>' + '</div>';
    return html;
  }

  function resolveRating(rating) {
    if (rating && rating.value) {
      return ' / ' + rating.value + '星';
    }
    return '';
  }

  function resolveTags(tags) {
    if (tags && tags.length > 0) {
      var html = ' / ';
      for (var i = 0; i < tags.length; ++i) {
        html += tags[i] + ' ';
      }
      return html;
    }
    return '';
  }

  setTimeout(function() {
    loadDoubanCollections();
  }, 0)
})()
</script>









</body>
</html>